-- background: 2815 from stack: in.0 -- bmap block id: 3214 -- flags: 4000 -- background id: 0 -- name: Data ----- HyperTalk script ----- on idle global checkMark if the icon of bg btn id 31 is 23736 then exit idle if optionKey() is down then set icon of bg btn id 6 to 518 set icon of bg btn id 5 to 9904 if bg field id 7 is not empty then set style of bg btn id 21 to rectangle set showName of bg btn id 21 to true end if put true into checkMark else if checkMark is true then set icon of bg btn id 6 to 9902 set icon of bg btn id 5 to 1943 set showName of bg btn id 21 to false set style of bg btn id 21 to transparent put false into checkMark end if end idle on openCard if bg field id 7 is not empty then set hilite of bg btn id 21 to true else set hilite of bg btn id 21 to false end if end openCard on closeField put the date into line 1 of field ID 3 end closeField on newCard put the date into line 2 of field id 3 click at loc of field id 18 end newCard function check put bg field id 24 into hi if not ((length of hi) is 8 and (char 3 of hi) = "/" and (char 6 of hi) = "/") then goof return true end if put value(char 1 to 2 of hi) into mon put value(char 4 to 5 of hi) into day if day <1 or day >31 or mon <1 or mon >12 then goof return true end if return false end check on goof if random(2) = 1 then play "goofed up" else play "does not compute" end if end goof -- part 18 (field) -- low flags: 03 -- high flags: 0000 -- rect: left=15 top=31 right=57 bottom=322 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 18 -- style flags: 0 -- line height: 24 -- part name: Name* -- part 2 (field) -- low flags: 03 -- high flags: 0000 -- rect: left=36 top=168 right=223 bottom=340 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Phone Number* ----- HyperTalk script ----- on closeField repeat with lineNumber = 1 to 3 put word 1 of line lineNumber of me into temp if temp = empty then next repeat if (length of word 1 of line lineNumber of me) = 7 then put "(206)" & (char 1 to 3 of temp) & "-" & (char 4 to 7 of temp) into more put more into word 1 of line lineNumber of me end if if (length of word 1 of line lineNumber of me) = 10 then put "(" & (char 1 to 3 of temp) & ")" & (char 4 to 6 of temp) & "-" & (char 7 to 10 of temp) into more put more into word 1 of line lineNumber of me end if if (length of word 1 of line lineNumber of me) ≠ 13 then goof select line lineNumber of me exit closeField end if end repeat pass closeField end closeField -- part 1 (field) -- low flags: 03 -- high flags: 0000 -- rect: left=15 top=55 right=164 bottom=339 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Address* -- part 5 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=169 top=226 right=252 bottom=197 -- title width / last selected line: 0 -- icon id / first selected line: 1943 / 1943 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp if the optionKey is down then goNote else go to prev card end if end mouseUp on goNote repeat until mouseClick() go to prev card if bg field id 7 is not empty then exit repeat end repeat end goNote -- part 6 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=218 top=226 right=252 bottom=244 -- title width / last selected line: 0 -- icon id / first selected line: 9902 / 9902 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp if the optionKey is down then goNote else go to next card end if end mouseUp on goNote repeat until mouseClick() go to next card if bg field id 7 is not empty then exit repeat end repeat end goNote -- part 11 (field) -- low flags: 03 -- high flags: 0000 -- rect: left=72 top=290 right=307 bottom=143 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Age ----- HyperTalk script ----- on mouseUp put field ID 24 into bday if bday is empty then put empty into me exit mouseUp end if if check() then exit mouseUp put the date into today convert bday to dateItems convert today to dateItems put (item 1 of today - item 1 of bday) into age if item 2 of bday > item 2 of today then subtract 1 from age if item 2 of bday = item 2 of today and item 3 of bday > item 3 of today then subtract 1 from age if age < 0 then goof put empty into field ID 11 exit mouseUp end if put age into field ID 11 end mouseUp -- part 3 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=282 top=220 right=254 bottom=354 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Date -- part 12 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=15 top=164 right=188 bottom=38 -- title width / last selected line: 0 -- icon id / first selected line: 10610 / 10610 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp get the selection if it is empty then get first word of field ID 2 if it is empty then ask "Dial what number?" if it is not empty then push this card openSpeed go to stack "Phone" dial it pop card closeSpeed hide msg end if end mouseUp -- part 15 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=196 top=231 right=250 bottom=218 -- title width / last selected line: 0 -- icon id / first selected line: 11045 / 11045 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp visual dissolve to gray visual dissolve go home end mouseUp -- part 17 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=245 top=222 right=252 bottom=286 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 24 -- style flags: 0 -- line height: 32 -- part name: Page Number ----- HyperTalk script ----- on mouseUp openSpeed repeat with x=1 to number of cards in this bg set cursor to busy go to card x of bg 1 if the mouseClick then exit repeat put x into field ID 17 end repeat closeSpeed openCard end mouseUp -- part 19 (button) -- low flags: 00 -- high flags: A003 -- rect: left=377 top=262 right=284 bottom=497 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New Card ----- HyperTalk script ----- on mouseUp if icon of bg btn id 31 is 28736 then beep put "Unlock input first!" into msg exit mouseUp end if doMenu new card end mouseUp -- part 21 (button) -- low flags: 00 -- high flags: 4000 -- rect: left=382 top=220 right=249 bottom=486 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Delete note ----- HyperTalk script ----- on mouseUp show field ID 7 show bg button ID 23 if bg fld id 7 is empty then select char 1 of fld id 7 exit mouseUp end if if optionKey() is down then answer "Delete this note?" with "Yes" or "No" if it is "Yes" then put empty into fld id 7 send mouseUp to bg btn id 23 end if end mouseUp -- part 24 (field) -- low flags: 03 -- high flags: 0000 -- rect: left=72 top=266 right=283 bottom=143 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Birthday* ----- HyperTalk script ----- on closeField if me is empty then put empty into bg field id 11 pass returnInField end if if char 2 of me is "/" then put "0" before me if char 5 of me is "/" then put "0" after char 3 of me if (length of me) = 4 then put "0" before me put "0" before char 3 of me end if if (length of me) = 5 then put "0" before me if (length of me) = 6 then put line 1 of me into temp put (char 1 to 2 of temp) & "/" & (char 3 to 4 of temp) & "/" & (char 5 to 6 of temp) into me end if if check() then select line 1 of me exit closeField end if send mouseUp to bg fld id 11 pass closeField end closeField on mouseUp put checkBirth(me) into msg end mouseUp -- part 26 (button) -- low flags: 00 -- high flags: A003 -- rect: left=377 top=288 right=310 bottom=497 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Delete card ----- HyperTalk script ----- on mouseUp answer "Kill this card?" with "Yes" or "No" if it is "Yes" then doMenu delete card end if end mouseUp -- part 29 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=137 top=225 right=253 bottom=170 -- title width / last selected line: 0 -- icon id / first selected line: 8538 / 8538 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Find help ----- HyperTalk script ----- on mouseUp doMenu find... end mouseUp -- part 28 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=10 top=283 right=309 bottom=38 -- title width / last selected line: 0 -- icon id / first selected line: 1009 / 1009 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Check birth day ----- HyperTalk script ----- on mouseUp openSpeed put the date into today put the number of cards in bg 1 into y if char 2 of today is "/" then put "0" before today repeat with x = 1 to y percent x,y go card x in bg 1 if the mouseClick then exit repeat if field ID 24 is empty then put empty into field ID 11 next repeat else put field ID 24 into bday if the number of chars in bday ≠ 8 then beep next repeat end if if checkBirth(bday) < 7 then send mouseUp to bg fld id 11 beep answer word 1 of bg field id 18 & "'s birthday is near!!!" with "Continue" or "Stop" if it is "Stop" then closeSpeed hide msg exit mouseUp end if end if end if end repeat closeSpeed hide msg go first Card in bg 1 end mouseUp -- part 32 (button) -- low flags: 00 -- high flags: A003 -- rect: left=377 top=314 right=336 bottom=497 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Sort Cards ----- HyperTalk script ----- on mouseUp openSpeed answer "Sort cards by what?" with "First Name" or "Last Name" or "Cancel" if it is "Cancel" then exit mouseUp if it is "Birthday" then sort by bg field id 24 if it is "First Name" then sort by word 1 of bg field id 18 if it is "Last Name" then sort by last word of bg field id 18 go bg 1 send mouseUp to bg field id 17 go card 1 in bg 1 closeSpeed end mouseUp -- part 33 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=101 top=224 right=254 bottom=138 -- title width / last selected line: 0 -- icon id / first selected line: 11645 / 11645 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Go index ----- HyperTalk script ----- on mouseUp go bg 2 end mouseUp -- part 31 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=315 top=27 right=63 bottom=350 -- title width / last selected line: 0 -- icon id / first selected line: 28736 / 28736 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Level change ----- HyperTalk script ----- on mouseUp get the icon of me if it is 28736 then unLot false set textArrows to true set icon of me to 13430 play Floop else unLot true set textArrows to false play bluup set icon of me to 28736 end if end mouseUp on unLot test set lockText of fld id 18 to test set lockText of fld id 1 to test set lockText of fld id 24 to test set lockText of fld id 2 to test end unLot -- part 7 (field) -- low flags: 80 -- high flags: 6001 -- rect: left=5 top=24 right=338 bottom=504 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Notes ----- HyperTalk script ----- on closeField hide me hide bg button ID 23 openCard end closeField -- part 23 (button) -- low flags: 80 -- high flags: 0001 -- rect: left=473 top=310 right=336 bottom=503 -- title width / last selected line: 0 -- icon id / first selected line: 19678 / 19678 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Quit note ----- HyperTalk script ----- on mouseUp hide field ID 7 hide me openCard end mouseUp